 $(function () {
	//修改用户昵称
 	updateNiki =  function(basepath){
 		var nikiname = $("#newnikiname").val();
 		$.post(basepath+"/updateNiki.action",{
                              "nikiname" : nikiname
                            },function(data) {
                            	if (data.sucflag) {
                            		location.reload() 
                            	}
                            });
 	};
 	//修改密码
 	updatePassword = function(basepath){
 		var oldpassword = $("#oldpassword").val().trim();
 		var newpassword = $("#newpassword").val().trim();
 		if(oldpassword != "" && newpassword != ""){
	 		$.post(basepath+"/updatePassword.action",{
	                              "oldpassword" : oldpassword,
	                              "newpasssword":newpassword
	                            },function(data) {
	                            	if (data.slogin) {
					if (data.sucflag) {
						alert("修改成功！");
	                            			location.reload();
	                            		}else{
	                            			alert("原密码输入错误！");
	                            		}
	                            	}else{
	                            		window.location.href = basepath+"/gologin.action";
	                            	}
	                            	
	                            });	
 		}
 	}; 	

 })